package starfire;

import java.awt.*;
import javax.swing.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: </p>
 * @author zzzhc.starfire@gmail.com
 * @version 1.0
 */

public class JFtp {
  boolean packFrame = false;

  //Construct the application
  public JFtp() {
    JFtpFrame frame = new JFtpFrame();

    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout

    if (packFrame) {
      frame.pack();
    }
    else {
      frame.validate();
    }
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = frame.getSize();
    if (frameSize.height > screenSize.height) {
      frameSize.height = screenSize.height;
    }
    if (frameSize.width > screenSize.width) {
      frameSize.width = screenSize.width;
    }
    frame.setLocation( (screenSize.width - frameSize.width) / 2,
                      (screenSize.height - frameSize.height) / 2);
    frame.setVisible(true);
    frame.setExtendedState(Frame.MAXIMIZED_BOTH);
  }

  //Main method

  public static void main(String[] args) {

    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      Font font=new Font("DialogInput",Font.PLAIN,12);
      String names[]={"Label","CheckBox","PopupMenu","TextPane",
                      "MenuItem","CheckBoxMenuItem","JRadioButtonMenuItem",
                      "ComboBox","Button","Tree","ScrollPane","TabbedPane",
                      "EditorPane","TitledBorder","Menu","TextArea","OptionPane",
                      "MenuBar","ToolBar","ToggleButton","ToolTip","ProgressBar",
                      "TableHeader","Panel","List","ColorChooser","PasswordField",
                      "TextField","Table","Label","Viewport","RadioButtonMenuItem",
                      "RadioButton"};
       for(int i=0;i<names.length;i++) {
         UIManager.put(names[i] + ".font", font);
       }
       UIManager.put("Label.foreground",Color.black);
       UIManager.put("Border.foreground",Color.black);
       UIManager.put("TitledBorder.titleColor",Color.black);
    }
    catch (Exception e) {
      e.printStackTrace();
    }
    new JFtp();
  }
}
